import myspringbootstart.config.tomcat.WebServerFactory;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;

@ComponentScan("myspringbootstart")
public class bootStart {
    public static void main(String[] args) throws Exception {
//          AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
//          context.register(AppConfig.class);
//
//        // Create and register the DispatcherServlet
//        DispatcherServlet servlet = new DispatcherServlet(context);
//        ServletRegistration.Dynamic registration = servletContext.addServlet("app", servlet);
//        registration.setLoadOnStartup(1);
//        registration.addMapping("/app/*");
        //test
        //1、启动SpringIOC容器
        AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
        context.register(bootStart.class);
        context.refresh();
        //
        WebServerFactory server = context.getBean(WebServerFactory.class);
        server.createServer();


    }
}
